from datetime import datetime

start = datetime(year=1901, day=1, month=1)
end = datetime(year=2000, day=31, month=12)
result = 0
while start <= end:
    if start.weekday() == 6:
        result += 1
    next_month = start.month + 1
    next_year = start.year
    if next_month == 13:
        next_month = 1
        next_year += 1
    start = datetime(year=next_year, day=1, month=next_month)
print(result)
